package com.lanyou.esb.cook.proxy.vo;

import com.lanyou.esb.cook.proxy.common.CommonUtils;

/**
 * 异常消息体
 * 
 * @author Davey.wu
 */
public class ErrorMsg {
	private String errorCode;
	private String errorDesc;

	public static ErrorMsg getInstance(String errorCode, String errorDesc) {
		ErrorMsg msg = new ErrorMsg();
		msg.errorCode = errorCode;
		msg.errorDesc = errorDesc;
		return msg;
	}

	public String toJson() {
		String result = "";
		try {
			result = CommonUtils.toJson(this);
		} catch (Exception e) {
			result = e.getMessage();
		}
		return result;
	}

	public String getErrorCode() {
		return errorCode;
	}

	public void setErrorCode(String errorCode) {
		this.errorCode = errorCode;
	}

	public String getErrorDesc() {
		return errorDesc;
	}

	public void setErrorDesc(String errorDesc) {
		this.errorDesc = errorDesc;
	}

}
